﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
    [TestClass]
    public class ReportType_Intrusion_Test
    {
        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test01_Equals()
        {
            ReportType_Intrusion reportTypeIntrusion = new ReportType_Intrusion(false, eReportSubType_Intrusion.HostageTaking);

            {
                // completely different type - NOT equal
                object dummyObject = new object();
                Assert.IsFalse(reportTypeIntrusion.Equals(dummyObject));
            }

            {
                // same type - same property values
                ReportType_Intrusion reportTypeIntrusion2compare = new ReportType_Intrusion(reportTypeIntrusion.OnOffFlag, reportTypeIntrusion.ReportSubType);
                Assert.IsTrue(reportTypeIntrusion.Equals(reportTypeIntrusion2compare));
            }

            {
                // same type - different OnOffFlag
                ReportType_Intrusion reportTypeIntrusion2compare = new ReportType_Intrusion(!reportTypeIntrusion.OnOffFlag, reportTypeIntrusion.ReportSubType);
                Assert.IsFalse(reportTypeIntrusion.Equals(reportTypeIntrusion2compare));
            }

            {
                // same type - different ReportSubType
                eReportSubType_Intrusion reportSubTypeIntrusion = eReportSubType_Intrusion.Assault;
                if (reportTypeIntrusion.ReportSubType == eReportSubType_Intrusion.Assault)
                {
                    reportSubTypeIntrusion = eReportSubType_Intrusion.Burglary;
                }
                ReportType_Intrusion reportTypeIntrusion2compare = new ReportType_Intrusion(reportTypeIntrusion.OnOffFlag, reportSubTypeIntrusion);
                Assert.IsFalse(reportTypeIntrusion.Equals(reportTypeIntrusion2compare));
            }
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test02_GetHashCode()
        {
            ReportType_Intrusion reportTypeIntrusion = new ReportType_Intrusion(false, eReportSubType_Intrusion.Sabotage);
            int hashCode01 = reportTypeIntrusion.GetHashCode();
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test03_ToString()
        {
            ReportType_Intrusion reportTypeIntrusion = new ReportType_Intrusion(true, eReportSubType_Intrusion.Burglary);
            string stringResult = reportTypeIntrusion.ToString();
            Assert.IsNotNull(stringResult);
        }
    }
}
